package collection_day1;

import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;

public class HashTableDemo {

	public static void main(String[] args) {
		method();
	}
	private static void  method(){
		Hashtable<String, Integer>table=new Hashtable<String,Integer>();
		table.put("one", 1);
		table.put("two", 2);
		table.put("three", 3);
		table.put("four", 4);
		table.put("five", 5);
		System.out.println("table: "+table);
		
		Iterator iter=table.entrySet().iterator();
		while (iter.hasNext()) {
			Map.Entry entry = (Map.Entry)iter.next();
			System.out.println("next : "+ entry.getKey() +" - "+entry.getValue());
		}
	}
}
